% Function V(q)
% Usage: y = func_V(q, m, CONSTS)
% use_V==false -> V=1; use_V==true -> V=...

function y = func_V(q, m, CONSTS)
    k0  = CONSTS.k0;
    a   = CONSTS.a;
    eps = CONSTS.eps;
    eta = CONSTS.eta;
    eps_a = CONSTS.eps_a;
    use_V = CONSTS.use_V;
    
    if (use_V)
        y = (eps_a/(((eps*eta)^0.5))) * ...
            (1 ./                                      ...
                (                                                           ...
                    (sin((k0*a*q)-(m*pi/2)-(pi/4))).^2 +                  ...
                    ((((eps_a)^2)/(eps*eta))*(cos((k0*a*q)-(m*pi/2)-(pi/4))).^2)          ...
                )                                                           ...
              ) ;
    else
        y = ones(size(q));
    end
    
end
